package com.yizhang.principle.compositereuse;

/**
 * @Author: yi.zhang
 * @CreateTime: 2025-08-21 15:36:49
 * @Description:
 */
public class ProductDao {
    private DBConnection connection;

    public void setConnection(DBConnection connection) {
        this.connection = connection;
    }

    public void getProduct() {
        // 需要哪个子类 就获取哪个子类的连接
        connection.getConnection();
    }
}
